# -*- coding: utf-8 -*-
from datetime import timedelta
from utils.operators.spark_submit import SparkSubmitOperator

from jms.ods.tab.tab_barscan_sign import jms_ods__tab_barscan_sign
from jms.ods.tab.tab_barscan_collect import jms_ods__tab_barscan_collect
from jms.ods.tab.tab_barscan_centerarrival import jms_ods__tab_barscan_centerarrival
from jms.ods.tab.tab_barscan_centersend import jms_ods__tab_barscan_centersend
from jms.ods.tab.tab_barscan_unloading import jms_ods__tab_barscan_unloading
from jms.ods.lmdm.yl_lmdm_sys_network import jms_ods__yl_lmdm_sys_network
from jms.ods.oms.yl_oms_oms_waybill import jms_ods__yl_oms_oms_waybill
from jms.ods.tab.tab_barscan_taking import jms_ods__tab_barscan_taking
from jms.ods.tab.tab_barscan_warehousing import jms_ods__tab_barscan_warehousing
from jms.ods.tab.tab_barscan_send import jms_ods__tab_barscan_send
from jms.ods.tab.tab_reback_transfer_express import jms_ods__tab_reback_transfer_express
from jms.ods.tab.tab_barscan_difficult import jms_ods__tab_barscan_difficult
from jms.ods.tms.yl_tmsnew_tms_shipment import jms_ods__yl_tmsnew_tms_shipment
from jms.ods.tab.tab_barscan_sitesend import jms_ods__tab_barscan_sitesend
from jms.ods.tab.tab_barscan_arrival import jms_ods__tab_barscan_arrival
from jms.ods.lmdm.yl_lmdm_sys_network_expand import jms_ods__yl_lmdm_sys_network_expand

# 揽收漏扫明细
dm__dm_taking_scan_miss_detail = SparkSubmitOperator(
    task_id='dm__dm_taking_scan_miss_detail',
    pool_slots=11,
    task_concurrency=1,  # 如果任务不支持并发，则将 task_concurrency 设为 1
    name='dm__dm_taking_scan_miss_detail_{{ execution_date | date_add(1) | cst_ds }}',
    driver_memory='12G',
    executor_memory='12G',
    executor_cores=8,
    num_executors=16,
    email=['guoruiling@jtexpress.com','yl_bigdata@yl-scm.com'],
    conf={'spark.executor.memoryOverhead': 4096,
          'spark.core.connection.ack.wait.timeout': 5000,
          'spark.default.parallelism': 600,
          'spark.locality.wait': 60,
          'spark.driver.maxResultSize': 20,
          },
    java_class='com.yunlu.bigdata.jobs.export.ExportTakingScanMissDetail',
    #application='hdfs:///user/oozie/zhuyongtao/taking_miss_scan/TakingScanMiss.jar',
    application='hdfs:///scheduler/jms/spark/zyt/taking_miss_scan/TakingScanMiss.jar',
    application_args=['{{ execution_date | cst_ds }}'],
    execution_timeout=timedelta(minutes=90),
)

dm__dm_taking_scan_miss_detail << [
jms_ods__tab_barscan_sign,
jms_ods__tab_barscan_collect,
jms_ods__tab_barscan_centerarrival,
jms_ods__tab_barscan_centersend,
jms_ods__tab_barscan_unloading,
jms_ods__yl_lmdm_sys_network,
jms_ods__yl_oms_oms_waybill,
jms_ods__tab_barscan_taking,
jms_ods__tab_barscan_warehousing,
jms_ods__tab_barscan_send,
jms_ods__tab_reback_transfer_express,
jms_ods__tab_barscan_difficult,
jms_ods__yl_tmsnew_tms_shipment,
jms_ods__tab_barscan_sitesend,
jms_ods__tab_barscan_arrival,
jms_ods__yl_lmdm_sys_network_expand
]